/*
 Navicat Premium Dump SQL

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 110402 (11.4.2-MariaDB-ubu2404)
 Source Host           : localhost:3306
 Source Schema         : chaos

 Target Server Type    : MySQL
 Target Server Version : 110402 (11.4.2-MariaDB-ubu2404)
 File Encoding         : 65001

 Date: 05/12/2024 20:10:14
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for application
-- ----------------------------
DROP TABLE IF EXISTS `application`;
CREATE TABLE `application` (
  `id` bigint(20) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `avatar` varchar(255) DEFAULT NULL,
  `cover` varchar(255) DEFAULT NULL,
  `status` tinyint(4) DEFAULT NULL,
  `percent` int(11) DEFAULT 0,
  `logo` varchar(255) DEFAULT NULL,
  `href` varchar(255) DEFAULT NULL,
  `body` varchar(255) DEFAULT NULL,
  `sub_description` varchar(255) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `active_user` int(11) DEFAULT 0,
  `like_count` int(11) DEFAULT 0,
  `star` int(11) DEFAULT NULL,
  `message` int(11) DEFAULT NULL,
  `content` varchar(255) DEFAULT NULL,
  `create_time` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '创建',
  `modify_time` datetime NOT NULL DEFAULT current_timestamp(),
  `is_delete` tinyint(4) NOT NULL DEFAULT 0,
  `version` int(11) NOT NULL DEFAULT 1,
  `updater` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '编辑人',
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建人',
  `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户 id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='应用中心';

-- ----------------------------
-- Records of application
-- ----------------------------
BEGIN;
INSERT INTO `application` (`id`, `owner`, `title`, `avatar`, `cover`, `status`, `percent`, `logo`, `href`, `body`, `sub_description`, `description`, `active_user`, `like_count`, `star`, `message`, `content`, `create_time`, `modify_time`, `is_delete`, `version`, `updater`, `creator`, `tenant_id`) VALUES (1, 'user1', 'App1', 'avatar1.jpg', 'cover1.jpg', 1, 100, 'logo1.png', 'http://app1.com', 'Body1', 'SubDesc1', 'Desc1', 100, 50, 10, 5, 'Content1', '2024-11-28 15:03:00', '2024-11-28 15:03:00', 0, 1, 'admin', 'admin', 1);
INSERT INTO `application` (`id`, `owner`, `title`, `avatar`, `cover`, `status`, `percent`, `logo`, `href`, `body`, `sub_description`, `description`, `active_user`, `like_count`, `star`, `message`, `content`, `create_time`, `modify_time`, `is_delete`, `version`, `updater`, `creator`, `tenant_id`) VALUES (2, 'user2', 'App2', 'avatar2.jpg', 'cover2.jpg', 1, 80, 'logo2.png', 'http://app2.com', 'Body2', 'SubDesc2', 'Desc2', 200, 70, 15, 10, 'Content2', '2024-11-28 15:03:00', '2024-11-28 15:03:00', 0, 1, 'admin', 'admin', 1);
INSERT INTO `application` (`id`, `owner`, `title`, `avatar`, `cover`, `status`, `percent`, `logo`, `href`, `body`, `sub_description`, `description`, `active_user`, `like_count`, `star`, `message`, `content`, `create_time`, `modify_time`, `is_delete`, `version`, `updater`, `creator`, `tenant_id`) VALUES (3, 'user3', 'App3', 'avatar3.jpg', 'cover3.jpg', 1, 90, 'logo3.png', 'http://app3.com', 'Body3', 'SubDesc3', 'Desc3', 150, 60, 12, 8, 'Content3', '2024-11-28 15:03:00', '2024-11-28 15:03:00', 0, 1, 'admin', 'admin', 1);
INSERT INTO `application` (`id`, `owner`, `title`, `avatar`, `cover`, `status`, `percent`, `logo`, `href`, `body`, `sub_description`, `description`, `active_user`, `like_count`, `star`, `message`, `content`, `create_time`, `modify_time`, `is_delete`, `version`, `updater`, `creator`, `tenant_id`) VALUES (4, 'user4', 'App4', 'avatar4.jpg', 'cover4.jpg', 1, 70, 'logo4.png', 'http://app4.com', 'Body4', 'SubDesc4', 'Desc4', 120, 40, 8, 6, 'Content4', '2024-11-28 15:03:00', '2024-11-28 15:03:00', 0, 1, 'admin', 'admin', 1);
INSERT INTO `application` (`id`, `owner`, `title`, `avatar`, `cover`, `status`, `percent`, `logo`, `href`, `body`, `sub_description`, `description`, `active_user`, `like_count`, `star`, `message`, `content`, `create_time`, `modify_time`, `is_delete`, `version`, `updater`, `creator`, `tenant_id`) VALUES (5, 'user5', 'App5', 'avatar5.jpg', 'cover5.jpg', 1, 100, 'logo5.png', 'http://app5.com', 'Body5', 'SubDesc5', 'Desc5', 180, 80, 18, 12, 'Content5', '2024-11-28 15:03:00', '2024-11-28 15:03:00', 0, 1, 'admin', 'admin', 1);
INSERT INTO `application` (`id`, `owner`, `title`, `avatar`, `cover`, `status`, `percent`, `logo`, `href`, `body`, `sub_description`, `description`, `active_user`, `like_count`, `star`, `message`, `content`, `create_time`, `modify_time`, `is_delete`, `version`, `updater`, `creator`, `tenant_id`) VALUES (6, 'user6', 'App6', 'avatar6.jpg', 'cover6.jpg', 1, 85, 'logo6.png', 'http://app6.com', 'Body6', 'SubDesc6', 'Desc6', 130, 55, 11, 7, 'Content6', '2024-11-28 15:03:00', '2024-11-28 15:03:00', 0, 1, 'admin', 'admin', 1);
INSERT INTO `application` (`id`, `owner`, `title`, `avatar`, `cover`, `status`, `percent`, `logo`, `href`, `body`, `sub_description`, `description`, `active_user`, `like_count`, `star`, `message`, `content`, `create_time`, `modify_time`, `is_delete`, `version`, `updater`, `creator`, `tenant_id`) VALUES (7, 'user7', 'App7', 'avatar7.jpg', 'cover7.jpg', 1, 95, 'logo7.png', 'http://app7.com', 'Body7', 'SubDesc7', 'Desc7', 160, 75, 14, 9, 'Content7', '2024-11-28 15:03:00', '2024-11-28 15:03:00', 0, 1, 'admin', 'admin', 1);
INSERT INTO `application` (`id`, `owner`, `title`, `avatar`, `cover`, `status`, `percent`, `logo`, `href`, `body`, `sub_description`, `description`, `active_user`, `like_count`, `star`, `message`, `content`, `create_time`, `modify_time`, `is_delete`, `version`, `updater`, `creator`, `tenant_id`) VALUES (8, 'user8', 'App8', 'avatar8.jpg', 'cover8.jpg', 1, 75, 'logo8.png', 'http://app8.com', 'Body8', 'SubDesc8', 'Desc8', 110, 45, 9, 5, 'Content8', '2024-11-28 15:03:00', '2024-11-28 15:03:00', 0, 1, 'admin', 'admin', 1);
INSERT INTO `application` (`id`, `owner`, `title`, `avatar`, `cover`, `status`, `percent`, `logo`, `href`, `body`, `sub_description`, `description`, `active_user`, `like_count`, `star`, `message`, `content`, `create_time`, `modify_time`, `is_delete`, `version`, `updater`, `creator`, `tenant_id`) VALUES (9, 'user9', 'App9', 'avatar9.jpg', 'cover9.jpg', 1, 88, 'logo9.png', 'http://app9.com', 'Body9', 'SubDesc9', 'Desc9', 140, 65, 13, 8, 'Content9', '2024-11-28 15:03:00', '2024-11-28 15:03:00', 0, 1, 'admin', 'admin', 1);
INSERT INTO `application` (`id`, `owner`, `title`, `avatar`, `cover`, `status`, `percent`, `logo`, `href`, `body`, `sub_description`, `description`, `active_user`, `like_count`, `star`, `message`, `content`, `create_time`, `modify_time`, `is_delete`, `version`, `updater`, `creator`, `tenant_id`) VALUES (10, '22331', 'App10', 'avatar10.jpg', 'cover10.jpg', 1, 92, 'logo10.png', 'http://app10.com', 'Body10', 'SubDesc10', 'Desc10', 170, 78, 16, 10, 'Content10', '2024-11-28 15:03:00', '2024-11-29 01:02:26', 1, 4, 'admin', 'admin', 1);
INSERT INTO `application` (`id`, `owner`, `title`, `avatar`, `cover`, `status`, `percent`, `logo`, `href`, `body`, `sub_description`, `description`, `active_user`, `like_count`, `star`, `message`, `content`, `create_time`, `modify_time`, `is_delete`, `version`, `updater`, `creator`, `tenant_id`) VALUES (1862158222715797506, '222', NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, '2024-11-28 23:34:52', '2024-11-29 00:23:21', 1, 2, '', '', 0);
INSERT INTO `application` (`id`, `owner`, `title`, `avatar`, `cover`, `status`, `percent`, `logo`, `href`, `body`, `sub_description`, `description`, `active_user`, `like_count`, `star`, `message`, `content`, `create_time`, `modify_time`, `is_delete`, `version`, `updater`, `creator`, `tenant_id`) VALUES (1862162754275393538, '333', NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, '2024-11-28 23:52:52', '2024-11-29 00:23:26', 1, 3, '', '', 0);
INSERT INTO `application` (`id`, `owner`, `title`, `avatar`, `cover`, `status`, `percent`, `logo`, `href`, `body`, `sub_description`, `description`, `active_user`, `like_count`, `star`, `message`, `content`, `create_time`, `modify_time`, `is_delete`, `version`, `updater`, `creator`, `tenant_id`) VALUES (1862172198573015042, '223111112', NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, '2024-11-29 00:30:24', '2024-11-29 01:00:16', 1, 4, '', '', 0);
INSERT INTO `application` (`id`, `owner`, `title`, `avatar`, `cover`, `status`, `percent`, `logo`, `href`, `body`, `sub_description`, `description`, `active_user`, `like_count`, `star`, `message`, `content`, `create_time`, `modify_time`, `is_delete`, `version`, `updater`, `creator`, `tenant_id`) VALUES (1862172214574284802, '2232', NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, '2024-11-29 00:30:28', '2024-11-29 00:30:28', 1, 1, '', '', 0);
COMMIT;

-- ----------------------------
-- Table structure for oauth_access_token
-- ----------------------------
DROP TABLE IF EXISTS `oauth_access_token`;
CREATE TABLE `oauth_access_token` (
  `authentication_id` varchar(256) NOT NULL,
  `token_id` varchar(256) DEFAULT NULL,
  `token` blob DEFAULT NULL,
  `user_name` varchar(256) DEFAULT NULL,
  `client_id` varchar(256) DEFAULT NULL,
  `authentication` blob DEFAULT NULL,
  `refresh_token` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`authentication_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

-- ----------------------------
-- Records of oauth_access_token
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for oauth_approvals
-- ----------------------------
DROP TABLE IF EXISTS `oauth_approvals`;
CREATE TABLE `oauth_approvals` (
  `user_id` varchar(256) DEFAULT NULL,
  `client_id` varchar(256) DEFAULT NULL,
  `scope` varchar(256) DEFAULT NULL,
  `status` varchar(10) DEFAULT NULL,
  `expiresAt` timestamp NULL DEFAULT NULL,
  `lastModifiedAt` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

-- ----------------------------
-- Records of oauth_approvals
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for oauth_client_details
-- ----------------------------
DROP TABLE IF EXISTS `oauth_client_details`;
CREATE TABLE `oauth_client_details` (
  `client_id` varchar(256) NOT NULL,
  `client_secret` varchar(256) DEFAULT NULL,
  `resource_ids` varchar(256) DEFAULT NULL,
  `scope` varchar(256) DEFAULT NULL,
  `authorized_grant_types` varchar(256) NOT NULL COMMENT '指定客户端支持的grant_type,可选值包括authorization_code,password,refresh_token,implicit,client_credentials',
  `web_server_redirect_uri` varchar(256) DEFAULT NULL,
  `authorities` varchar(256) DEFAULT NULL,
  `access_token_validity` int(11) DEFAULT NULL,
  `refresh_token_validity` int(11) DEFAULT NULL,
  `additional_information` varchar(4096) DEFAULT NULL,
  `autoapprove` varchar(256) DEFAULT NULL,
  `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户 id',
  PRIMARY KEY (`client_id`) USING BTREE,
  UNIQUE KEY `inx_client_id` (`client_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

-- ----------------------------
-- Records of oauth_client_details
-- ----------------------------
BEGIN;
INSERT INTO `oauth_client_details` (`client_id`, `client_secret`, `resource_ids`, `scope`, `authorized_grant_types`, `web_server_redirect_uri`, `authorities`, `access_token_validity`, `refresh_token_validity`, `additional_information`, `autoapprove`, `tenant_id`) VALUES ('openapi', 'VIlA38m0G2YwZ1nS', NULL, 'all', 'client_credentials,refresh_token', 'http://localhost:18888', NULL, 604800, 0, '开放 API', NULL, 1);
INSERT INTO `oauth_client_details` (`client_id`, `client_secret`, `resource_ids`, `scope`, `authorized_grant_types`, `web_server_redirect_uri`, `authorities`, `access_token_validity`, `refresh_token_validity`, `additional_information`, `autoapprove`, `tenant_id`) VALUES ('saas', 'VIlA38m0G2YwZ1nS', NULL, 'all', 'admin_phone,admin_username,refresh_token', 'http://localhost:18888', NULL, 604800, 0, 'saas 平台', NULL, 1);
INSERT INTO `oauth_client_details` (`client_id`, `client_secret`, `resource_ids`, `scope`, `authorized_grant_types`, `web_server_redirect_uri`, `authorities`, `access_token_validity`, `refresh_token_validity`, `additional_information`, `autoapprove`, `tenant_id`) VALUES ('test', 'test', NULL, NULL, 'admin_phone,admin_username', NULL, NULL, 1, 1, 'test', NULL, 2);
COMMIT;

-- ----------------------------
-- Table structure for oauth_client_details_permission
-- ----------------------------
DROP TABLE IF EXISTS `oauth_client_details_permission`;
CREATE TABLE `oauth_client_details_permission` (
  `id` bigint(20) NOT NULL COMMENT 'ID',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  `is_delete` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除，1：已删除，0未删除',
  `version` int(11) NOT NULL DEFAULT 1 COMMENT '版本',
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建人',
  `updater` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '编辑人',
  `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户 id',
  `client_id` varchar(256) NOT NULL,
  `permission_id` bigint(20) NOT NULL COMMENT '权限id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='客户端权限表';

-- ----------------------------
-- Records of oauth_client_details_permission
-- ----------------------------
BEGIN;
INSERT INTO `oauth_client_details_permission` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `creator`, `updater`, `tenant_id`, `client_id`, `permission_id`) VALUES (1863640040791097345, '2024-12-03 01:43:05', '2024-12-03 01:43:05', 0, 1, '', '', 1, 'openapi', 1862933960767410179);
INSERT INTO `oauth_client_details_permission` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `creator`, `updater`, `tenant_id`, `client_id`, `permission_id`) VALUES (1864032497710137346, '2024-12-04 03:42:34', '2024-12-04 03:42:34', 0, 1, '', '', 1, 'openapi', 1862933960767410179);
COMMIT;

-- ----------------------------
-- Table structure for oauth_client_token
-- ----------------------------
DROP TABLE IF EXISTS `oauth_client_token`;
CREATE TABLE `oauth_client_token` (
  `authentication_id` varchar(256) NOT NULL,
  `token_id` varchar(256) DEFAULT NULL,
  `token` blob DEFAULT NULL,
  `user_name` varchar(256) DEFAULT NULL,
  `client_id` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`authentication_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

-- ----------------------------
-- Records of oauth_client_token
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for oauth_code
-- ----------------------------
DROP TABLE IF EXISTS `oauth_code`;
CREATE TABLE `oauth_code` (
  `code` varchar(256) DEFAULT NULL,
  `authentication` blob DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

-- ----------------------------
-- Records of oauth_code
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for oauth_refresh_token
-- ----------------------------
DROP TABLE IF EXISTS `oauth_refresh_token`;
CREATE TABLE `oauth_refresh_token` (
  `token_id` varchar(256) DEFAULT NULL,
  `token` blob DEFAULT NULL,
  `authentication` blob DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

-- ----------------------------
-- Records of oauth_refresh_token
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for rbac_menu
-- ----------------------------
DROP TABLE IF EXISTS `rbac_menu`;
CREATE TABLE `rbac_menu` (
  `id` bigint(20) NOT NULL COMMENT 'ID',
  `component` varchar(32) DEFAULT NULL COMMENT '组件',
  `icon` varchar(64) DEFAULT NULL COMMENT '图标',
  `redirect` varchar(512) DEFAULT NULL COMMENT '重定向路径',
  `exact` tinyint(4) DEFAULT 1 COMMENT '是否精确匹配 1：是，0否',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `modify_time` datetime DEFAULT NULL COMMENT '修改时间',
  `version` int(11) DEFAULT 1 COMMENT '版本',
  `is_delete` tinyint(4) DEFAULT 0 COMMENT '是否删除，1：已删除，0未删除',
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建人',
  `updater` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '编辑人',
  `tenant_id` bigint(20) DEFAULT 0 COMMENT '租户 id',
  `path` varchar(512) DEFAULT NULL COMMENT '路由路径',
  `name` varchar(64) DEFAULT NULL COMMENT '路由名称',
  `cn_name` varchar(64) DEFAULT NULL COMMENT '名称',
  `parent_id` bigint(20) DEFAULT 0 COMMENT '父级id',
  `menu_type` tinyint(4) DEFAULT 1 COMMENT '菜单类型',
  `sort` smallint(6) DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='菜单';

-- ----------------------------
-- Records of rbac_menu
-- ----------------------------
BEGIN;
INSERT INTO `rbac_menu` (`id`, `component`, `icon`, `redirect`, `exact`, `create_time`, `modify_time`, `version`, `is_delete`, `creator`, `updater`, `tenant_id`, `path`, `name`, `cn_name`, `parent_id`, `menu_type`, `sort`) VALUES (1, NULL, 'table', NULL, 1, '2024-12-03 14:47:08', '2024-12-03 14:47:08', 1, 0, '', '', 0, '/tenant', 'tenant', '租户中心', NULL, 1, 1);
INSERT INTO `rbac_menu` (`id`, `component`, `icon`, `redirect`, `exact`, `create_time`, `modify_time`, `version`, `is_delete`, `creator`, `updater`, `tenant_id`, `path`, `name`, `cn_name`, `parent_id`, `menu_type`, `sort`) VALUES (2, NULL, 'table', NULL, 1, '2024-12-03 14:47:08', '2024-12-03 14:47:08', 1, 0, '', '', 0, '/auth', 'auth', '认证中心', NULL, 1, 1);
INSERT INTO `rbac_menu` (`id`, `component`, `icon`, `redirect`, `exact`, `create_time`, `modify_time`, `version`, `is_delete`, `creator`, `updater`, `tenant_id`, `path`, `name`, `cn_name`, `parent_id`, `menu_type`, `sort`) VALUES (3, './tenant/tTenant', 'table', NULL, 1, '2024-12-03 14:47:08', '2024-12-03 14:47:08', 1, 0, '', '', 0, 'tTenant', 'tTenant', '租户管理', 1, 1, 1);
INSERT INTO `rbac_menu` (`id`, `component`, `icon`, `redirect`, `exact`, `create_time`, `modify_time`, `version`, `is_delete`, `creator`, `updater`, `tenant_id`, `path`, `name`, `cn_name`, `parent_id`, `menu_type`, `sort`) VALUES (4, './tenant/oauthClientDetails', 'table', NULL, 1, '2024-12-03 14:47:08', '2024-12-03 14:47:08', 1, 0, '', '', 0, 'oauthClientDetails', 'oauthClientDetails', '客户端管理', 1, 1, 1);
INSERT INTO `rbac_menu` (`id`, `component`, `icon`, `redirect`, `exact`, `create_time`, `modify_time`, `version`, `is_delete`, `creator`, `updater`, `tenant_id`, `path`, `name`, `cn_name`, `parent_id`, `menu_type`, `sort`) VALUES (5, './auth/rbacPermission', 'table', NULL, 1, '2024-12-03 14:47:08', '2024-12-03 14:47:08', 1, 0, '', '', 0, 'rbacPermission', 'rbacPermission', '权限管理', 1, 1, 1);
INSERT INTO `rbac_menu` (`id`, `component`, `icon`, `redirect`, `exact`, `create_time`, `modify_time`, `version`, `is_delete`, `creator`, `updater`, `tenant_id`, `path`, `name`, `cn_name`, `parent_id`, `menu_type`, `sort`) VALUES (6, './auth/rbacMenu', 'table', NULL, 1, '2024-12-03 14:47:08', '2024-12-03 14:47:08', 1, 0, '', '', 0, 'rbacMenu', 'rbacMenu', '菜单管理', 1, 1, 1);
INSERT INTO `rbac_menu` (`id`, `component`, `icon`, `redirect`, `exact`, `create_time`, `modify_time`, `version`, `is_delete`, `creator`, `updater`, `tenant_id`, `path`, `name`, `cn_name`, `parent_id`, `menu_type`, `sort`) VALUES (7, './auth/rbacUser', 'table', NULL, 1, '2024-12-03 14:47:08', '2024-12-03 14:47:08', 1, 0, '', '', 0, 'rbacUser', 'rbacUser', '管理员', 2, 1, 1);
INSERT INTO `rbac_menu` (`id`, `component`, `icon`, `redirect`, `exact`, `create_time`, `modify_time`, `version`, `is_delete`, `creator`, `updater`, `tenant_id`, `path`, `name`, `cn_name`, `parent_id`, `menu_type`, `sort`) VALUES (8, '/auth/rbacRole', 'table', NULL, 1, '2024-12-03 14:47:08', '2024-12-03 14:47:08', 1, 0, '', '', 0, 'rbacRole', 'rbacRole', '角色管理', 2, 1, 1);
COMMIT;

-- ----------------------------
-- Table structure for rbac_menu_btn
-- ----------------------------
DROP TABLE IF EXISTS `rbac_menu_btn`;
CREATE TABLE `rbac_menu_btn` (
  `id` bigint(20) NOT NULL COMMENT 'ID',
  `name` varchar(128) DEFAULT NULL COMMENT '按钮名称',
  `btn_perm` varchar(128) DEFAULT NULL COMMENT '按钮标识',
  `menu_id` bigint(20) NOT NULL COMMENT '菜单id',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  `is_delete` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除，1：已删除，0未删除',
  `version` int(11) NOT NULL DEFAULT 1 COMMENT '版本',
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建人',
  `updater` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '编辑人',
  `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户 id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='菜单按钮表';

-- ----------------------------
-- Records of rbac_menu_btn
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for rbac_permission
-- ----------------------------
DROP TABLE IF EXISTS `rbac_permission`;
CREATE TABLE `rbac_permission` (
  `id` bigint(20) NOT NULL COMMENT 'ID',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  `is_delete` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除，1：已删除，0未删除',
  `version` int(11) NOT NULL DEFAULT 1 COMMENT '版本',
  `name` varchar(128) NOT NULL COMMENT '权限名称',
  `url_perm` varchar(128) NOT NULL COMMENT 'url权限标识',
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建人',
  `updater` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '编辑人',
  `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户 id',
  `type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1，admin 接口 2，open 接口',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='权限表';

-- ----------------------------
-- Records of rbac_permission
-- ----------------------------
BEGIN;
INSERT INTO `rbac_permission` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `name`, `url_perm`, `creator`, `updater`, `tenant_id`, `type`) VALUES (1862933960767410178, '2024-12-01 02:57:22', '2024-12-01 02:57:22', 0, 1, 'rbacUser&&page.admin', 'POST:/auth/rbacUser/page.admin', '', '', 0, 1);
INSERT INTO `rbac_permission` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `name`, `url_perm`, `creator`, `updater`, `tenant_id`, `type`) VALUES (1862933960767410179, '2024-12-01 02:57:22', '2024-12-01 02:57:22', 0, 1, 'rbacUser&&page.open', 'POST:/auth/rbacUser/page.open', '', '', 0, 2);
COMMIT;

-- ----------------------------
-- Table structure for rbac_permission_menu_btn
-- ----------------------------
DROP TABLE IF EXISTS `rbac_permission_menu_btn`;
CREATE TABLE `rbac_permission_menu_btn` (
  `id` bigint(20) NOT NULL COMMENT 'ID',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  `is_delete` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除，1：已删除，0未删除',
  `version` int(11) NOT NULL DEFAULT 1 COMMENT '版本',
  `permission_id` bigint(20) NOT NULL COMMENT '权限id',
  `menu_or_btn_id` bigint(20) NOT NULL COMMENT '菜单或按钮id',
  `correlation_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '关联类型 1 菜单 2 按钮',
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建人',
  `updater` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '编辑人',
  `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户 id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='权限菜单按钮关联表';

-- ----------------------------
-- Records of rbac_permission_menu_btn
-- ----------------------------
BEGIN;
INSERT INTO `rbac_permission_menu_btn` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `permission_id`, `menu_or_btn_id`, `correlation_type`, `creator`, `updater`, `tenant_id`) VALUES (1863672680978100226, '2024-12-03 03:52:47', '2024-12-03 03:52:47', 0, 1, 1862933960767410178, 56, 1, '', '', 1);
INSERT INTO `rbac_permission_menu_btn` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `permission_id`, `menu_or_btn_id`, `correlation_type`, `creator`, `updater`, `tenant_id`) VALUES (1864032431201058817, '2024-12-04 03:42:18', '2024-12-04 03:42:18', 0, 1, 1862933960767410178, 1, 1, '', '', 1);
COMMIT;

-- ----------------------------
-- Table structure for rbac_role
-- ----------------------------
DROP TABLE IF EXISTS `rbac_role`;
CREATE TABLE `rbac_role` (
  `id` bigint(20) NOT NULL COMMENT 'ID',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  `is_delete` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除，1：已删除，0未删除',
  `version` int(11) NOT NULL DEFAULT 1 COMMENT '版本',
  `name` varchar(128) NOT NULL COMMENT '角色名称',
  `status` tinyint(4) DEFAULT NULL COMMENT '角色是否开启，1：开启，0未开启',
  `data_perm` tinyint(4) NOT NULL DEFAULT 3 COMMENT '0 全公司 1 部门及下级部门 2 当前部门 3个人',
  `description` varchar(255) NOT NULL COMMENT '描述',
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建人',
  `updater` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '编辑人',
  `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户 id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

-- ----------------------------
-- Records of rbac_role
-- ----------------------------
BEGIN;
INSERT INTO `rbac_role` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `name`, `status`, `data_perm`, `description`, `creator`, `updater`, `tenant_id`) VALUES (1, '2024-06-04 15:32:39', '2024-06-05 18:51:29', 0, 1, '超级管理员', 1, 0, '超级管理员', '', '', 1);
INSERT INTO `rbac_role` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `name`, `status`, `data_perm`, `description`, `creator`, `updater`, `tenant_id`) VALUES (3, '2024-06-04 15:32:39', '2024-06-05 18:51:29', 0, 1, '平台运营', 1, 0, '平台运营', '', '', 1);
INSERT INTO `rbac_role` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `name`, `status`, `data_perm`, `description`, `creator`, `updater`, `tenant_id`) VALUES (4, '2024-06-04 15:32:39', '2024-06-05 18:51:29', 0, 1, '财务人员', 1, 0, '财务人员', '', '', 1);
INSERT INTO `rbac_role` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `name`, `status`, `data_perm`, `description`, `creator`, `updater`, `tenant_id`) VALUES (5, '2024-06-04 15:32:39', '2024-06-05 18:51:29', 1, 1, '设备运维', 1, 0, '设备运维', '', '', 1);
INSERT INTO `rbac_role` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `name`, `status`, `data_perm`, `description`, `creator`, `updater`, `tenant_id`) VALUES (6, '2024-06-04 15:32:39', '2024-06-05 18:51:29', 0, 1, '平台客服', 1, 0, '平台客服', '', '', 1);
INSERT INTO `rbac_role` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `name`, `status`, `data_perm`, `description`, `creator`, `updater`, `tenant_id`) VALUES (1863124842472816641, '2024-12-01 15:35:52', '2024-12-01 15:35:52', 0, 1, '测试', 1, 0, '试试', '', '', 1);
COMMIT;

-- ----------------------------
-- Table structure for rbac_role_menu_btn
-- ----------------------------
DROP TABLE IF EXISTS `rbac_role_menu_btn`;
CREATE TABLE `rbac_role_menu_btn` (
  `id` bigint(20) NOT NULL COMMENT 'ID',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  `is_delete` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除，1：已删除，0未删除',
  `version` int(11) NOT NULL DEFAULT 1 COMMENT '版本',
  `role_id` bigint(20) NOT NULL COMMENT '角色id',
  `menu_or_btn_id` bigint(20) NOT NULL COMMENT '菜单或按钮id',
  `correlation_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '关联类型 1 菜单 2 按钮',
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建人',
  `updater` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '编辑人',
  `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户 id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='角色菜单按钮关联表';

-- ----------------------------
-- Records of rbac_role_menu_btn
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for rbac_user
-- ----------------------------
DROP TABLE IF EXISTS `rbac_user`;
CREATE TABLE `rbac_user` (
  `id` bigint(20) NOT NULL COMMENT 'ID',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  `is_delete` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除，1：已删除，0未删除',
  `version` int(11) NOT NULL DEFAULT 1 COMMENT '版本',
  `username` varchar(64) NOT NULL COMMENT '用户名',
  `password` varchar(68) NOT NULL COMMENT '密码',
  `mobile` varchar(16) DEFAULT NULL COMMENT '手机号',
  `status` tinyint(4) DEFAULT NULL COMMENT '账号是否锁定，1：启用，0: 禁用 2: 离职',
  `avatar` varchar(500) DEFAULT NULL COMMENT '用户头像',
  `email` varchar(100) DEFAULT NULL COMMENT '邮箱',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `real_name` varchar(64) DEFAULT NULL COMMENT '姓名',
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建人',
  `updater` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '编辑人',
  `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户 id',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `UNIQUE_username` (`username`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

-- ----------------------------
-- Records of rbac_user
-- ----------------------------
BEGIN;
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1481247973685805057, '2024-09-17 03:31:30', '2024-12-01 22:07:18', 0, 4, 'wuyanzu', '{bcrypt}$2a$10$wuP1ojUisJ5OAPoDyUf7.uo0A7Fe/pC3yVlMZrgdEvzZXYYR.P.oS', '555', 1, '', '555', '555555', '吴彦祖', '', '', 1);
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1481247973685805058, '2022-01-12 20:53:32', '2024-01-11 18:35:09', 0, 1, 'yjp', '{bcrypt}$2a$10$KkGs3FWc2sQxUHIKSytXsO6rrkNwjK5YHUc0mzK9TG.lsblhCHl96', '15188888888', 1, NULL, NULL, NULL, '刘德华', '', '', 1);
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1481247973685805059, '2022-01-12 20:53:32', '2024-01-11 18:35:09', 0, 1, 'lcw', '{bcrypt}$2a$10$KkGs3FWc2sQxUHIKSytXsO6rrkNwjK5YHUc0mzK9TG.lsblhCHl96', '18288888888', 1, NULL, NULL, NULL, '古天乐', '', '', 1);
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1481247973685805060, '2024-06-04 11:47:28', '2024-06-04 11:47:31', 0, 1, 'cjk', '{bcrypt}$2a$10$KkGs3FWc2sQxUHIKSytXsO6rrkNwjK5YHUc0mzK9TG.lsblhCHl96', '13288888888', 1, NULL, NULL, NULL, '林志宁', '', '', 1);
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1860403410445848577, '2024-11-24 03:21:52', '2024-11-24 03:21:52', 1, 1, 'cuicui', 'cuicui', NULL, NULL, NULL, NULL, NULL, '李连杰', '', '', 2);
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1860590763248496642, '2024-11-24 15:46:20', '2024-11-24 15:57:50', 0, 2, 'cuijian1', '{bcrypt}$2a$10$CmzTAI/tqsLsQeY4ZEwCvOkyw/y3q0SRCMDtPP7..B9mm33Wg/z92', '18825258888', 1, NULL, '632381896@qq.com', '1111111', NULL, '', '', 2);
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1862938667065905153, '2024-12-01 03:16:04', '2024-12-01 03:16:04', 0, 1, '11', '{bcrypt}$2a$10$zF6o0fQF3lBoS3hQfjQ2..CPHGJJVJ1RCWfmIp6DkokbwoLSV0mDC', '111', NULL, NULL, NULL, '1', NULL, '', '', 2);
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1862938879247355905, '2024-12-01 03:16:55', '2024-12-01 13:28:19', 0, 4, '22', '{bcrypt}$2a$10$GP6Fg8U7TYHGkt3lE.E9yOcwZG1DLkObbkGYzFr9sCwMYnqjIi2Gm', '222', 2, NULL, '222@qq.com', '122222', '222', '', '', 2);
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1863095191247622145, '2024-12-01 13:38:02', '2024-12-01 13:38:02', 0, 1, '333', '{bcrypt}$2a$10$a33So5nyyk9SmuPcy9c0dehccyreAIcLYZ/FZl54O6TqZDUxd1XVa', '333', 1, NULL, NULL, NULL, NULL, '', '', 2);
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1863096022197964802, '2024-12-01 13:41:21', '2024-12-01 13:43:24', 0, 2, '44', '{bcrypt}$2a$10$JsR9C6/cmF4xei1zqkwYfuA1PlezASdNyK7t1ijJKH0j1Iy3CwcEC', '44', 0, NULL, NULL, '44', NULL, '', '', 2);
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1863123329411203074, '2024-12-01 15:29:51', '2024-12-01 15:30:06', 0, 2, '555', '{bcrypt}$2a$10$beZtZ4ACnS4M.vTbGZXsAu5Mk1hBb6V15WJyMVcWhK.eQhhS0dnLC', '555', 0, NULL, '555', '55555', '555', '', '', 2);
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1863137337539313665, '2024-12-01 16:25:31', '2024-12-01 16:25:31', 0, 1, '666', '{bcrypt}$2a$10$pIbcE.0i3GXXn3uJC34sCuTZwvIwfPj6wlFchGZrtA1TExXfF5786', '666', 1, NULL, NULL, '666666', NULL, '', '', 2);
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1863139582959955970, '2024-12-01 16:34:26', '2024-12-01 16:34:26', 0, 1, '6666', '{bcrypt}$2a$10$1Rn7SmU9CwP3LS3k42zDROt6C9oFL6kgMJYgYe1R75RRajbYOu91O', '666', 1, NULL, NULL, '666666', NULL, '', '', 2);
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1863220954466729985, '2024-12-01 21:57:47', '2024-12-01 21:57:47', 0, 1, '888', '{bcrypt}$2a$10$e0IkT8ozz2bnL6pUxSS0IOUrnYvVi.KBiyB5hPk9664.Ooz/b1bU2', '888', 1, NULL, NULL, '888', NULL, '', '', 1);
INSERT INTO `rbac_user` (`id`, `create_time`, `modify_time`, `is_delete`, `version`, `username`, `password`, `mobile`, `status`, `avatar`, `email`, `remark`, `real_name`, `creator`, `updater`, `tenant_id`) VALUES (1863226681021284353, '2024-12-01 22:20:32', '2024-12-01 23:53:50', 0, 3, '999', '{bcrypt}$2a$10$gHJQ653.4.3xgKyUtq/eeeU.PA4ZBd0tCX.ss0k1FYZa7M3XQHfl2', '999', 1, NULL, '99', '99999', '99', '', '', 1);
COMMIT;

-- ----------------------------
-- Table structure for rbac_user_role
-- ----------------------------
DROP TABLE IF EXISTS `rbac_user_role`;
CREATE TABLE `rbac_user_role` (
  `id` bigint(20) NOT NULL COMMENT 'ID',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `is_delete` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除，1：已删除，0未删除',
  `version` int(11) NOT NULL DEFAULT 1 COMMENT '版本',
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `role_id` bigint(20) NOT NULL COMMENT '角色id',
  `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户 id',
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建人',
  `updater` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '编辑人',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

-- ----------------------------
-- Records of rbac_user_role
-- ----------------------------
BEGIN;
INSERT INTO `rbac_user_role` (`id`, `modify_time`, `create_time`, `is_delete`, `version`, `user_id`, `role_id`, `tenant_id`, `creator`, `updater`) VALUES (1863220954521255937, '2024-12-01 21:57:47', '2024-12-01 21:57:47', 0, 1, 1863220954466729985, 1, 1, '', '');
INSERT INTO `rbac_user_role` (`id`, `modify_time`, `create_time`, `is_delete`, `version`, `user_id`, `role_id`, `tenant_id`, `creator`, `updater`) VALUES (1863220954538033154, '2024-12-01 21:57:47', '2024-12-01 21:57:47', 0, 1, 1863220954466729985, 3, 1, '', '');
INSERT INTO `rbac_user_role` (`id`, `modify_time`, `create_time`, `is_delete`, `version`, `user_id`, `role_id`, `tenant_id`, `creator`, `updater`) VALUES (1863223351045898242, '2024-12-01 22:07:18', '2024-12-01 22:07:18', 0, 1, 1481247973685805057, 1, 1, '', '');
INSERT INTO `rbac_user_role` (`id`, `modify_time`, `create_time`, `is_delete`, `version`, `user_id`, `role_id`, `tenant_id`, `creator`, `updater`) VALUES (1863223351054286849, '2024-12-01 22:07:18', '2024-12-01 22:07:18', 0, 1, 1481247973685805057, 3, 1, '', '');
INSERT INTO `rbac_user_role` (`id`, `modify_time`, `create_time`, `is_delete`, `version`, `user_id`, `role_id`, `tenant_id`, `creator`, `updater`) VALUES (1863223351054286850, '2024-12-01 22:07:18', '2024-12-01 22:07:18', 0, 1, 1481247973685805057, 4, 1, '', '');
INSERT INTO `rbac_user_role` (`id`, `modify_time`, `create_time`, `is_delete`, `version`, `user_id`, `role_id`, `tenant_id`, `creator`, `updater`) VALUES (1863226681050644482, '2024-12-01 22:20:32', '2024-12-01 22:20:32', 0, 1, 1863226681021284353, 1, 1, '', '');
INSERT INTO `rbac_user_role` (`id`, `modify_time`, `create_time`, `is_delete`, `version`, `user_id`, `role_id`, `tenant_id`, `creator`, `updater`) VALUES (1863226681067421697, '2024-12-01 22:20:32', '2024-12-01 22:20:32', 1, 1, 1863226681021284353, 3, 1, '', '');
INSERT INTO `rbac_user_role` (`id`, `modify_time`, `create_time`, `is_delete`, `version`, `user_id`, `role_id`, `tenant_id`, `creator`, `updater`) VALUES (1863226681075810306, '2024-12-01 22:20:32', '2024-12-01 22:20:32', 1, 1, 1863226681021284353, 6, 1, '', '');
INSERT INTO `rbac_user_role` (`id`, `modify_time`, `create_time`, `is_delete`, `version`, `user_id`, `role_id`, `tenant_id`, `creator`, `updater`) VALUES (1863250071580864513, '2024-12-01 23:53:29', '2024-12-01 23:53:29', 1, 1, 1863226681021284353, 1863124842472816641, 1, '', '');
COMMIT;

-- ----------------------------
-- Table structure for t_config
-- ----------------------------
DROP TABLE IF EXISTS `t_config`;
CREATE TABLE `t_config` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '配置key名称',
  `value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '配置值',
  `type` int(11) NOT NULL DEFAULT 1 COMMENT '配置类型 1:系统配置,2:业务配置',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态（正常:0、禁用:1、删除2）',
  `create_time` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',
  `modify_time` datetime NOT NULL DEFAULT current_timestamp(),
  `is_delete` tinyint(4) NOT NULL DEFAULT 0,
  `version` int(11) NOT NULL DEFAULT 1,
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建人',
  `updater` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '编辑人',
  `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户 id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='系统配置表';

-- ----------------------------
-- Records of t_config
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_order
-- ----------------------------
DROP TABLE IF EXISTS `t_order`;
CREATE TABLE `t_order` (
  `id` bigint(20) unsigned NOT NULL COMMENT '订单id',
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '订单状态 1: 未支付 2:已支付',
  `total_amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '总金额',
  `pay_amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '实付金额',
  `phone` varchar(40) DEFAULT '' COMMENT '手机号',
  `channel` tinyint(4) NOT NULL DEFAULT 0 COMMENT '订单来源：1，微信小程序；2，支付宝小程序；3，高德小程序 ',
  `pay_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '支付方式：1，支付宝；2，微信；3，余额账户；',
  `pay_time` timestamp NULL DEFAULT NULL COMMENT '支付时间',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `create_time` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',
  `modify_time` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `is_delete` tinyint(4) NOT NULL DEFAULT 0,
  `version` int(11) NOT NULL DEFAULT 1,
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建人',
  `updater` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '编辑人',
  `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户 id',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_createtime` (`create_time`) USING BTREE,
  KEY `idx_user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='订单表';

-- ----------------------------
-- Records of t_order
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for t_tenant
-- ----------------------------
DROP TABLE IF EXISTS `t_tenant`;
CREATE TABLE `t_tenant` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `phone` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'phone',
  `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '头像',
  `remark` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '用户备注',
  `last_login_time` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '最后登陆',
  `status` int(11) DEFAULT 0 COMMENT '用户状态 1 已删除 0 在使用中',
  `create_time` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '创建',
  `modify_time` datetime NOT NULL DEFAULT current_timestamp(),
  `is_delete` tinyint(4) NOT NULL DEFAULT 0,
  `version` int(11) NOT NULL DEFAULT 1,
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建人',
  `updater` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '编辑人',
  `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户 id',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '租户名',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uniq_phone` (`phone`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1810565220497301507 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='租户：B 端用户';

-- ----------------------------
-- Records of t_tenant
-- ----------------------------
BEGIN;
INSERT INTO `t_tenant` (`id`, `phone`, `avatar`, `remark`, `last_login_time`, `status`, `create_time`, `modify_time`, `is_delete`, `version`, `creator`, `updater`, `tenant_id`, `name`) VALUES (1, '18825287196', 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', '哇喽', '2024-11-18 09:53:31', 0, '2024-11-18 09:53:31', '2024-12-02 18:06:38', 0, 3, '', '', 0, '巨猩科技');
INSERT INTO `t_tenant` (`id`, `phone`, `avatar`, `remark`, `last_login_time`, `status`, `create_time`, `modify_time`, `is_delete`, `version`, `creator`, `updater`, `tenant_id`, `name`) VALUES (2, '18825287198', 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', '哇喽哇喽', '2024-11-18 09:53:31', 0, '2024-11-18 09:53:31', '2024-12-02 18:06:38', 0, 3, '', '', 0, '美猩科技');
COMMIT;

-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `phone` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'phone',
  `nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '昵称',
  `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '头像',
  `ali_open_id` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '支付宝用户openid',
  `wx_open_id` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '微信open id',
  `remark` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '用户备注',
  `create_time` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '创建',
  `last_login_time` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '最后登陆',
  `status` int(11) DEFAULT 0 COMMENT '用户状态 1 已删除 0 在使用中',
  `birthday` date DEFAULT NULL COMMENT '生日',
  `gender` tinyint(4) DEFAULT NULL COMMENT '性别 保密、男、女 对应0、1 、2',
  `modify_time` datetime NOT NULL DEFAULT current_timestamp(),
  `is_delete` tinyint(4) NOT NULL DEFAULT 0,
  `version` int(11) NOT NULL DEFAULT 1,
  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建人',
  `updater` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '编辑人',
  `tenant_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '租户 id',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uniq_phone` (`phone`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1810565220497301507 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='C端用户';

-- ----------------------------
-- Records of t_user
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
